from flask import session,redirect
from functools import wraps

def checklogin(func):
    def inner(*args,**kwargs):
        if session.get("username"):
            return func(*args,**kwargs)
        else:
            return redirect("/login")
    return inner